<?php

class Application_Model_DbTable_PayCodeType extends Application_Model_DbTable_DomainObject{
    
    protected $_name = 'uuch_paycode_type';
    
    public function getMapper() {
        return array('id','name','money','stocknum','sellnum','type','image');
    }
    
    public  function getByType($type){
            
            $db = $this->getAdapter();
            $filter = $db->quoteInto(' type = ?', $type);            
            $rows = $this->fetchAll($filter,'id',NULL,0);
            
            $result = array();
            foreach ($rows as $row){
                array_push($result,$this->convertRowToObject($row));                    
            }           
            return $result;

        }
}